package com.heima.admin.controller.v1;

import com.heima.admin.service.LoginService;
import com.heima.model.admin.dtos.AdUserDTO;
import com.heima.model.common.dtos.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "登录实现接口",tags = "登陆实现接口")
@RestController
public class LoginController {
    @Autowired
    private LoginService loginService;

    /**
     * 用户登录功能实现
     * @param dto 封装数据对象
     * @return
     */
    @ApiOperation("登录功能实现")
    @PostMapping("/login/in")
    public ResponseResult login(@RequestBody AdUserDTO dto){
        return loginService.login(dto);
    }
}
